<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/WEB-INF/views/wx/include/head.jsp" %>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a href="${ctxWx}/pu/my" class="mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">关于发票</h1>
	</header>
	<div class="mui-content">
		<div class="mui-segmented-control mui-segmented-control-inverted">
			<a class="mui-control-item tabType mui-active">开票申请</a>
			<a class="mui-control-item tabType" data-href="${ctxWx }/pu/rcpt/history">开票记录</a>
		</div>
		<form id="rcptForm" action="${ctxWx }/pu/rcpt/userInfo" method="post">
			<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
				<c:forEach items="${ordersList}" var="orders">
					<li class="mui-table-view-cell">
						<div class="mui-table">
							<div class="mui-table-cell mui-col-xs-10 ">
								<div style="float:left;padding:6px 0px;">
									<input class="item" type="checkbox" name="rcptIds"  style="width:20px;height:20px;" value="${orders.orderid }"/>
								</div>
								<div style="margin-left:30px;flat:clean;">
									<p style="color:#000000;font-size:14px;"><span style="margin-right:14px;">订单号</span>：${orders.orderid }</p>
									<p style="color:#000000;">产品名称：${orders.ordername }</p>
									<p style="color:#000000;">支付时间：<fmt:formatDate value="${orders.paydate }" pattern="yyyy-MM-dd" /></p>
								</div>
							</div>
							<div class="mui-table-cell mui-col-xs-2 mui-text-right">
								<p style="color:#f0ad4e;font-weight:bold;"><i class="icon-yen"></i>${orders.dueamount}</p>
							</div>
						</div>
					</li>
				</c:forEach>
			</ul>
			<c:if test="${empty ordersList}">
				<div style="padding:30px;text-align:center;font-size:14px;color:#9e9e9e;">
					没有需要开票的订单
				</div>
			</c:if>
		</form>
		<div class="fix-bottom2" style="margin-bottom:50px;"></div>
	</div>
	<nav class="mui-bar mui-bar-tab" style="padding-right:10px;">
		<button type="button" class="mui-btn mui-btn-primary mui-pull-right" onclick="check();">索取发票</button>
	</nav>
	<%@ include file="/WEB-INF/views/wx/include/script.jsp"%>
	<script type="text/javascript">
		$(function(){
			$('.tabType').on('tap',function(){
				var href=$(this).attr('data-href');
				if(href){
					window.location.href=href;
				}
			});
		});
		function check(){
			var items = $('.item:checked');
			if(items.length==0){
				mui.alert('请选择开票的订单');
				return;
			}
			$('#rcptForm').submit();
		}
	</script>
</body>
</html>